<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	protected function _initCustomLibraries()
	{
		$autoloader = Zend_Loader_Autoloader::getInstance();

		$autoloader->registerNamespace('Karaoke_');
	}

	protected function _initView()
	{
		$this->bootstrap('layout');

        $layout = $this->getResource('layout');
		$view = $layout->getView();
		
		$view->doctype('XHTML1_STRICT');
		$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
		$view->headTitle('Versus')->setSeparator(' - ');
	}
	
	protected function _initNavigation()
	{
		$this->bootstrap('layout');
		$this->bootstrap('frontController');
		
		$layout = $this->getResource('layout');
		$view = $layout->getView();
		
		$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
		
		$navigation = new Zend_Navigation($config);
		
		$view->navigation($navigation);
	}
	
	protected function _initPlugins()
	{
		$controller = $this->getResource('frontController');

		$auth = Zend_Auth::getInstance();
		$acl = new Karaoke_Acl($auth);
		
		$controller->registerPlugin(new Karaoke_Plugin_Auth($auth, $acl));
	}
	
	protected function _initSessions()
	{
		$session = new Zend_Session_Namespace('Karaoke');
		
		Zend_Registry::set('session', $session);
	}

}

